package com.common.InterceptorChain;

import java.util.HashMap;
import java.util.Map;

/**
 * 业务上下文
 *
 * @author 大忽悠
 * @create 2022/9/24 17:39
 */
public class BusinessContext {
    /**
     * 上下文中保存的属性
     */
    private Map<Object, Object> attrs = new HashMap<>();

    public Object getAttr(Object key) {
        return attrs.get(key);
    }

    public void putAttr(Object key, Object val) {
        attrs.put(key, val);
    }

    public void putAttr(Map<Object, Object> attrs) {
        this.attrs.putAll(attrs);
    }
}
